﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Globalization;
using System.Configuration;

namespace WebCore.App_Start
{
    public sealed class  MyAppConfig
    {
        public static string Lang_Current
        {
            get
            { 
                CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentUICulture;
                return ci.Name;
            }
        }
        public static int Admin_PageSize
        {
            get
            {
                string pageSize = ConfigurationManager.AppSettings["Admin_PageSize"];
                return Int32.Parse(pageSize);
            }
        }
        public static string File_CommentFolder
        {
            get
            {
                return ConfigurationManager.AppSettings["File_CommentFolder"];
            }
        }
        public static int Front_PageSize
        {
            get
            {
                string pageSize = ConfigurationManager.AppSettings["Front_PageSize"];
                return Int32.Parse(pageSize);
            }
        }
        //
        public const string State_Active = "1";
        public const string State_Inactive = "0";
        public const string State_Deleted = "-1";
        public const string State_Locked = "-2";
        
        //
        public const string Role_Administration = "Quản trị viên";
        public const string Role_Guests = "Khách vãng lai";
        public const string Role_Membership = "Thành viên";
        public const string Role_Moderation = "Làm nội dung";
        //
        public const string Level_Diamond = "1";
        public const string Level_Gold = "2";
        public const string Level_Silver = "3";
        //
        public static Dictionary<string, string> StateDictionary
        { 
            get
            {
                Dictionary<string, String> rs = new Dictionary<string, string>();
                rs.Add(State_Active, WebCore.Resources.Setting.State_Active);
                rs.Add(State_Inactive, WebCore.Resources.Setting.State_Inactive);
                rs.Add(State_Deleted, WebCore.Resources.Setting.State_Deleted);
                return rs;
            }
        }

        public static Dictionary<string, string> UserStateDictionary
        {
            get
            {
                Dictionary<string, String> rs = new Dictionary<string, string>();
                rs.Add(State_Active, WebCore.Resources.Setting.State_Active);
                rs.Add(State_Inactive, WebCore.Resources.Setting.UserState_Inactive);
                rs.Add(State_Locked, WebCore.Resources.Setting.State_Lock);
                rs.Add(State_Deleted, WebCore.Resources.Setting.State_Deleted);
                return rs;
            }
        }
       
        //
        public static Dictionary<string, string> StateCssDictionary
        {
            get
            {
                Dictionary<string, String> rs = new Dictionary<string, string>();
                rs.Add(State_Active, "active");
                rs.Add(State_Inactive, "inactive");
                rs.Add(State_Deleted, "deleted");
                rs.Add(State_Locked, "lock");
                return rs;
            }
        }
        //
        public string Resources { get; set; }
    }
}